import scala.io.StdIn
object HelloScala {
  def main(args: Array[String]): Unit = {
    var arr:Array[String] = Array("spark","scala","java","python")
    println(arr.mkString("Array(", ", ", ")"))
    arr.foreach(println)
    class Phone(color:String,var price:Int,isOpen:Boolean) {
      def printInfo(): Unit = {
        println(color + " " + price + " " + isOpen + " ")
        println(s"该手机的颜色是$color,价格是$price,开机状态是$isOpen")
      }
    }
    val xiaomi = new Phone("white",1299,true)
    xiaomi.printInfo()
    println("请输入接头暗号:")
    val word:String = StdIn.readLine()
    if (word =="好好学习") {
      println("暗号正确!")
    } else {
      println("暗号错误!")
    }
  }
}
